<?php /* Smarty version 2.6.18, created on 2010-03-13 17:48:36
         compiled from admin.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'admin.tpl', 75, false),)), $this); ?>
<div id="blanket" style="display:none;"></div>
<div id="editAddress" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<div id="editContact" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<div id="editPaymentInformation" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<script>	
	var da = new ekimo_drag_region("content","editAddress");
	var dc = new ekimo_drag_region("content","editContact");
	var dc = new ekimo_drag_region("content","editPaymentInformation");
</script>
<!-- <form name="mainForm" method="POST" id="mainForm"> -->
<div id="main_content">
    	<h1>Profile</h1>
			<div class="results">
				<table border="0" width="100%">	
					<tr>
						<td>Name :</td>
						<td><?php echo $this->_tpl_vars['name']; ?>
<!-- input type="text" name="user[name]" value="<?php echo $this->_tpl_vars['name']; ?>
" style="width:300px" --></td>
					</tr>
					<tr>
						<td>Trading Name :</td>
						<td><?php echo $this->_tpl_vars['trading_name']; ?>
<!-- input type="text" name="user[trading_name]" value="<?php echo $this->_tpl_vars['trading_name']; ?>
" style="width:300px" --></td>
					</tr>
					<tr>
						<td>Phone :</td>
						<td><?php echo $this->_tpl_vars['phone']; ?>
<!-- input type="text" name="user[phone]" value="<?php echo $this->_tpl_vars['phone']; ?>
" style="width:300px" --></td>
					</tr>
					<tr>
						<td>Fax :</td>
						<td><?php echo $this->_tpl_vars['fax']; ?>
<!-- input type="text" name="user[fax]" value="<?php echo $this->_tpl_vars['fax']; ?>
" style="width:300px" --></td>
					</tr>
					<tr>
						<td>Email :</td>
						<td><?php echo $this->_tpl_vars['email']; ?>
<!-- input type="text" name="user[email]" value="<?php echo $this->_tpl_vars['email']; ?>
" style="width:300px" --></td>
					</tr>
					<tr><td height="10px"></td></tr>
				</table>
			</div>
			
			
			<br><br>
			<!-- Address -->
        	<div class="blue">
    		    <form action="">
    		    <table style="width: 100%; vertical-align: middle;">
    		        <tr>
    		            <td><label for="search" style="font-weight: bold; font-size: 12pt">Address</label></td>
    		            <td style="text-align: right"><input type="button" value="New" onclick="editAddress(0,'');" />
    		            </td>
    		        </tr>
    		    </table>
    		    </form>
        	</div><!-- blue -->
        	<div id="results">
				 <div >
					<table border="0" width="100%">
						<tr><td colspan="9"><hr></td></tr>
						<tr>
							<?php if ($this->_tpl_vars['addressValue'][0]['address_type'] <> ''): ?>
								<td align="center" style="padding-left: 5pt; padding-right: 5pt">Edit</td>
							<?php endif; ?>
							<td>Type</td>
							<td>Street</td>
							<td>City</td>
							<td>Province</td>
							<td>Country</td>
							<td>Zip</td>
							<td align="center">Default</td>
							<td align="center">Inactive</td>
						</tr>
						<tr><td colspan="9"><hr></td></tr>
						<?php $_from = $this->_tpl_vars['addressValue']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['address']):
?>
						<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
							<?php if ($this->_tpl_vars['address']['address_type'] <> ''): ?>
								<td align="center"><a href="javascript:void(0);" onclick="editAddress('<?php echo $this->_tpl_vars['address']['address_id']; ?>
','<?php echo $this->_tpl_vars['address']['address_type']; ?>
');">Edit</a></td>						
							<?php endif; ?>
							<td><?php echo $this->_tpl_vars['address']['address_type']; ?>
</td>
							<td><?php echo $this->_tpl_vars['address']['address1']; ?>
 , <?php echo $this->_tpl_vars['address']['address2']; ?>
</td>
							<td><?php echo $this->_tpl_vars['address']['city']; ?>
</td>
							<td><?php echo $this->_tpl_vars['address']['province']; ?>
</td>
							<td><?php echo $this->_tpl_vars['address']['country']; ?>
</td>
							<td><?php echo $this->_tpl_vars['address']['zip']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['address']['primary_address']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['address']['inactive_address']; ?>
</td>
							<!-- <td align="center"><input type="checkbox" name="user[default][]" disabled="disabled" "<?php echo $this->_tpl_vars['address']['primary_address']; ?>
" /></td>
							<td align="center"><input type="checkbox" name="user[inactive][]" disabled="disabled" "$address.inactive_address}" /></td> -->
						</tr>
						<?php endforeach; endif; unset($_from); ?>
						<tr><td height="20"></td>
						</tr>
					</table>
				 </div>
            </div><!-- results -->
			
			

			<!-- <div class="blue">    
        		<form action="">
                	<label for="search">Contacts&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="button" value="New">&nbsp;&nbsp;
						<input type="button" value="Delete">
					</label>
                </form>
        	</div><!-- blue --> -->
        	
        	
			<br>
			<!-- Contact -->
			<div class="blue">
    		    <form action="">
    		    <table style="width: 100%; vertical-align: middle;">
    		        <tr>
    		            <td><label for="search" style="font-weight: bold; font-size: 12pt">Contacts</label></td>
    		            <td style="text-align: right"><input type="button" value="New" onclick="editContact(0);" />
    		            </td>
    		        </tr>
    		    </table>
    		    </form>
        	</div><!-- blue -->
        	<div id="results">
				 <div >
					<table border="0" width="100%">
						<tr><td colspan="7"><hr></td></tr>
						<tr>
							<?php if ($this->_tpl_vars['contactValue'][0]['contact_name'] <> ''): ?>
								<td align="center" style="padding-left: 5pt; padding-right: 5pt">Edit</td>
							<?php endif; ?>
							<td>Name</td>
							<td>Telephone</td>
							<td>Fax</td>
							<td>Email</td>
							<td align="center">Default</td>
							<td align="center">Inactive</td>
						</tr>
						<tr><td colspan="7"><hr></td></tr>
						<?php $_from = $this->_tpl_vars['contactValue']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['contact']):
?>
						<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
							<?php if ($this->_tpl_vars['contact']['contact_name'] <> ''): ?>
								<td align="center"><a href="javascript:void(0);" onclick="editContact('<?php echo $this->_tpl_vars['contact']['contact_id']; ?>
');">Edit</a></td>	
							<?php endif; ?>
							<td><?php echo $this->_tpl_vars['contact']['contact_name']; ?>
</td>
							<td><?php echo $this->_tpl_vars['contact']['telephone_no']; ?>
</td>
							<td><?php echo $this->_tpl_vars['contact']['fax_no']; ?>
</tdd>
							<td><?php echo $this->_tpl_vars['contact']['email']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['contact']['primary_contact']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['contact']['inactive_contact']; ?>
</td>					
						</tr>
						<?php endforeach; endif; unset($_from); ?>
					</table>
				</div>
			</div><!-- results -->
			<?php if ($this->_tpl_vars['orgType'] == 'Exporter'): ?>
				<br>
				<!-- PaymentInformation -->
				<div class="blue">
	    		    <form action="">
	    		    <table style="width: 100%; vertical-align: middle;">
	    		        <tr>
	    		            <td><label for="search" style="font-weight: bold; font-size: 12pt">Payment Informations</label></td>
	    		            <td style="text-align: right"><input type="button" value="New" onclick="editPaymentInformation(0);" />
	    		            </td>
	    		        </tr>
	    		    </table>
	    		    </form>
	        	</div><!-- blue -->	
				<?php if ($this->_tpl_vars['paymentsValue'][0]['title'] <> ''): ?>
		        	<div id="results">
						 <div >
							<table border="0" width="100%">
								<tr><td colspan="7"><hr></td></tr>
								<tr>
									<td align="center" style="padding-left: 5pt; padding-right: 5pt">Edit</td>
									<td>Description</td>
									<td align="center">Default?</td>
								</tr>
								<tr><td colspan="7"><hr></td></tr>
								<?php $_from = $this->_tpl_vars['paymentsValue']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['payment']):
?>
								<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
									<td align="center"><a href="javascript:void(0);" onclick="editPaymentInformation('<?php echo $this->_tpl_vars['payment']['id']; ?>
');">Edit</a></td>	
									<td><?php echo $this->_tpl_vars['payment']['title']; ?>
</td>
									<td align="center"><?php echo $this->_tpl_vars['payment']['default_payment']; ?>
</td>			
								</tr>
								<?php endforeach; endif; unset($_from); ?>
							</table>
						</div>
					</div><!-- results -->	
				<?php endif; ?>					
			<?php endif; ?>
</div>
<script language="javascript">
<?php echo '
	function viewAddress(address){
		doajaxAction("/account/adminProfile/addressType/"+address,0,"main_content");
	}
	
	function save(){
		doajaxAction("/account/saveProfile/",1,"",document.getElementById("mainForm"),true);
	}
    function editAddress(addressId,addType){
		doajaxAction("/account/editAddress/addressId/"+addressId+"/addressType/"+addType,0,\'editAddress\');
		popup("editAddress");
	}
	function editContact(contactId){
		doajaxAction("/account/editContact/contactId/"+contactId,0,\'editContact\');
		popup("editContact");
	}
	function editPaymentInformation(paymentId){
		doajaxAction("/account/editPaymentInformation/paymentId/"+paymentId,0,\'editPaymentInformation\');
		popup("editPaymentInformation");
	}	
'; ?>

</script>
<!-- </form> -->


<!-- onclick="openWindow('/account/editAddress/addressId/0/addressType/','address',500,500,'scrollbars=yes');"  -->